import java.util.Arrays;

public class Solution283 {

    public static void main(String[] args) {
        int[] nums1 = new int[]{2, 0, 1};
        moveZeroes(nums1);
        System.out.println(Arrays.toString(nums1));
    }


    public static void moveZeroes(int[] nums) {
        int left = 0;
        int right = 0;
        for (int i = 0; i < nums.length; i++) {
            if (nums[i] != 0) {
                nums[left] = nums[right];
                left++;
            }
            right++;
        }
        for (int i = left; i < nums.length; i++) {
            nums[i] = 0;
        }

    }

}
